Classic gapminder
Life expectancy is the size of points
Code is in the next page
6/22/2021
Life expectancy is the size of points
Code is in the next page
gapminder%>%
group_by(year,continent)%>%
summarize(across(c(pop,lifeExp,gdpPercap),
~mean(.x,na.rm=TRUE)),
.groups = "drop")%>%
plotly::plot_ly(x=~pop,
y=~gdpPercap,
size=~lifeExp,
color=~continent,
frame = ~year,
type="scatter",
mode="markers")